California Wildfires

Author

Lillian and Ainsley

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.4     ✔ tidyr     1.3.1
✔ purrr     1.0.4     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(readxl)

counties <- read_csv( "California_Counties_-3636863462195930370.csv", show_col_types = FALSE )

california <- read_csv("https://hub.arcgis.com/api/v3/datasets/c3c10388e3b24cec8a954ba10458039d_0/downloads/data?format=csv&spatialRefId=3857&where=1%3D1")
Rows: 22261 Columns: 21
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (12): STATE, AGENCY, UNIT_ID, FIRE_NAME, INC_NUM, ALARM_DATE, CONT_DATE,...
dbl  (9): OBJECTID, YEAR_, CAUSE, C_METHOD, OBJECTIVE, GIS_ACRES, DECADES, S...

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

Simulated Data

simulated_risk <- tibble(county = counties$`County Name`,
                         risk = runif(n = 58, min = 0, max = 100))

view(simulated_risk)

Wildfire Perimeter Map

library(tidyverse)
library(sf)
Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1; sf_use_s2() is TRUE
library(tmap)
library(geojsonsf)



fires <- geojson_sf("California_Fire_Perimeters_(1950%2B).geojson" )

recent_fires <- fires |>
  filter( YEAR_ == 2020 )

tmap_options( basemap.server = "USGS")
tmap_mode( "view" )
ℹ tmap mode set to "view".
tm_shape( recent_fires ) +
  tm_polygons( id = "FIRE_NAME", fill = "firebrick")

Precipitation Graph

precipitation_data <- california_precipitation_1

yearly_avg_precipitation <- precipitation_data |> group_by(Name, Year) |> summarize(total= sum(precipitation)) |> group_by(Name) |> ``summarize(avg_precip=mean(total))

ggplot(yearly_avg_precipitation)+ geom_line(aes(x=Year, y=avg_precip, color=Name))+ theme_bw(base_size = 12)+ theme(legend.position=“bottom”) + expand_limits(y=0) + labs(x=“Years”, y=“Average Precipitation”, title= “Avg.Precipitation for California Counties from 2015-2024”)